import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

type Result = {
  status: number;
  msg: string;
  success: boolean;
};

type ResultArrange = {
  success: boolean;
  data?: {
    list: Array<any>;
    totalCount: number;
  };
  msg?: string;
};

/** 获取任务安排列表 */
export const GetPage = (params?: object) => {
  return http.request<ResultArrange>(
    "get",
    baseUrlApi("/TaskArrangement/GetPage"),
    {
      params
    }
  );
};

//保存机构
export const Save = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("/TaskArrangement/Save"), {
    data
  });
};

//删除机构
export const Delete = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("/TaskArrangement/Delete"), {
    params: {
      id: data
    }
  });
};
